home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-06-15 | 609 b | 25 lines | [TEXT/DWat] |
- % PLANCK T(K) [ergs s-1 cm-2 Hs-1 steradians-1]
- % Calculate a Planck function
-
- % ARGUMENT:
- % T -- Temperature (in Kelvins)
- %
- % DESCRIPTION:
- % Use the frequencies (Hz) stored in the X vector and the specified
- % temperature T (Kelvins) to calculate the Planck function
- % Store the result in Y
-
- hide
- constants % Load some basic physical constants
-
- rpn <x h * k &1 * / dup % Calculate the argument to the exponential
-
- % Check to see to see if we might overflow the e^x function:
- rpn 5000 < xy * e^x 1 - 1 xy
- rpn dup 0 = + / dup 1 ≠ *
-
- % Multiply by the rest of the terms
- rpn 2 * h * <x 3 y^x * c dup * / >y
-
-
-